<nz-modal [(nzVisible)]="isVisible" [nzWidth]="modalWidth" (nzOnCancel)="onBack()">
  <div *nzModalTitle>{{ title }}</div>
  <ng-container *nzModalContent>
    <form [formGroup]="roomMaintenanceRecordForm" (keydown.enter)="$event.preventDefault()">
      <nz-row [nzGutter]="10">
        <nz-col [nzSpan]="12">
          <nz-form-item>
            <nz-form-label [nzSpan]="6" nzFor="roomNumber" nzRequired>房间号</nz-form-label>
            <nz-form-control [nzErrorTip]="'请选择房间号'">
              <nz-input-group nzSearch [nzAddOnAfter]="roomNumberSuffixIconButton">
                <input nz-input formControlName="roomNumber" placeholder="请选择房间号" readonly />
              </nz-input-group>
              <ng-template #roomNumberSuffixIconButton>
                <button nz-button nzType="primary" nzSearch (click)="findDormitoryRoom()"><nz-icon nzType="search" /></button>
              </ng-template>
            </nz-form-control>
          </nz-form-item>
        </nz-col>
        <nz-col [nzSpan]="12">
          <nz-form-item>
            <nz-form-label [nzSpan]="6" nzFor="staffName" nzRequired>员工姓名</nz-form-label>
            <nz-form-control [nzErrorTip]="'请选择员工姓名'">
              <nz-input-group nzSearch [nzAddOnAfter]="staffNameSuffixIconButton">
                <input nz-input formControlName="staffName" placeholder="请选择员工姓名" readonly />
              </nz-input-group>
              <ng-template #staffNameSuffixIconButton>
                <button nz-button nzType="primary" nzSearch (click)="findStaff()"><nz-icon nzType="search" /></button>
              </ng-template>
            </nz-form-control>
          </nz-form-item>
          <nz-form-item>
            <nz-form-label [nzSpan]="6" nzFor="staffPhone" nzRequired>员工联系电话</nz-form-label>
            <nz-form-control [nzErrorTip]="'请选择员工联系电话'">
              <nz-input-group nzSearch [nzAddOnAfter]="staffPhoneSuffixIconButton">
                <input nz-input formControlName="staffPhone" placeholder="请选择员工联系电话" readonly />
              </nz-input-group>
              <ng-template #staffPhoneSuffixIconButton>
                <button nz-button nzType="primary" nzSearch (click)="findStaff()"><nz-icon nzType="search" /></button>
              </ng-template>
            </nz-form-control>
          </nz-form-item>
        </nz-col>
      </nz-row>
      <nz-row [nzGutter]="10">
        <nz-col [nzSpan]="12">
          <nz-form-item>
            <nz-form-label [nzSpan]="6" nzFor="startTime">开始时间</nz-form-label>
            <nz-form-control >
              <nz-date-picker nzShowTime formControlName="startTime" nzFormat="yyyy-MM-dd HH:mm:ss"></nz-date-picker>
            </nz-form-control>
          </nz-form-item>
        </nz-col>
        <nz-col [nzSpan]="12">
          <nz-form-item>
            <nz-form-label [nzSpan]="6" nzFor="endTime">结束时间</nz-form-label>
            <nz-form-control >
              <nz-date-picker nzShowTime formControlName="endTime" nzFormat="yyyy-MM-dd HH:mm:ss"></nz-date-picker>
            </nz-form-control>
          </nz-form-item>
        </nz-col>
      </nz-row>
      <nz-row [nzGutter]="10">
        <nz-col [nzSpan]="12">
          <nz-form-item>
            <nz-form-label [nzSpan]="6" nzFor="content" nzRequired>维护内容</nz-form-label>
            <nz-form-control [nzErrorTip]="'请输入维护内容'">
              <input nz-input formControlName="content" placeholder="请输入维护内容" maxlength="65535"/>
            </nz-form-control>
          </nz-form-item>
        </nz-col>
      </nz-row>
    </form>
  </ng-container>
  <div *nzModalFooter>
    <div class="form-button-container">
      <button nz-button nzType="primary" (click)="onSave()" [nzLoading]="saveLoading">保存</button>
      <button nz-button nzType="default" (click)="onReset()" [nzLoading]="saveLoading">重置</button>
      <button nz-button nzType="default" (click)="onBack()">关闭</button>
    </div>
  </div>
</nz-modal>
<dormitory-room-selector (dormitoryRoomSelectedEvent)="handleDormitoryRoomSelectedEvent($event)"></dormitory-room-selector>
<staff-selector (staffSelectedEvent)="handleStaffSelectedEvent($event)"></staff-selector>
